package com.spring.demo.service;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * @version 1.0.0
 * @Date: 2022/5/27 15:18
 * @Author ZhuYouBin
 * @Description
 */
public class LogAroundAdvice implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        System.out.println("[日志打印]: 开始执行Aop的环绕通知......");
        // 调用目标对象的方法
        Object ret = methodInvocation.proceed();
        System.out.println("[日志打印]: 执行Aop的环绕通知完成......");
        return ret;
    }
}
